
import { useEffect } from 'react'

export function onMounted(cb, destroyedCb) {
  useEffect(() => {
    (typeof cb === 'function') && cb();
    return destroyedCb;
  }, [])
}